package com.music.music.service.impl;

import java.util.Date;
import java.util.List;

import com.music.music.vo.CommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.music.music.mapper.CommentMapper;
import com.music.music.domain.Comment;
import com.music.music.service.CommentService;

import javax.annotation.Resource;

/**
 * 用户评论Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-22
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;

    /**
     * 查询用户评论
     *
     * @param commentMusicId 用户评论主键
     * @return 用户评论
     */
    @Override
    public Comment selectCommentByCommentMusicId(Long commentMusicId) {
        return commentMapper.selectCommentByCommentMusicId(commentMusicId);
    }

    /**
     * 查询用户评论列表
     *
     * @param comment 用户评论
     * @return 用户评论
     */
    @Override
    public List<Comment> selectCommentList(Comment comment) {
        return commentMapper.selectCommentList(comment);
    }

    /**
     * 新增用户评论
     *
     * @param comment 用户评论
     * @return 结果
     */
    @Override
    public int insertComment(Comment comment) {
        return commentMapper.insertComment(comment);
    }

    /**
     * 修改用户评论
     *
     * @param comment 用户评论
     * @return 结果
     */
    @Override
    public int updateComment(Comment comment) {
        return commentMapper.updateComment(comment);
    }

    /**
     * 批量删除用户评论
     *
     * @param commentMusicIds 需要删除的用户评论主键
     * @return 结果
     */
    @Override
    public int deleteCommentByCommentMusicIds(Long[] commentMusicIds) {
        return commentMapper.deleteCommentByCommentMusicIds(commentMusicIds);
    }

    /**
     * 删除用户评论信息
     *
     * @param commentMusicId 用户评论主键
     * @return 结果
     */
    @Override
    public int deleteCommentByCommentMusicId(Long commentMusicId) {
        return commentMapper.deleteCommentByCommentMusicId(commentMusicId);
    }

    @Override
    public List<CommentVo> selectCommentList2(CommentVo commentVo) {
        return commentMapper.selectCommentListVo(commentVo);
    }

    @Override
    public int deleteCommentByCommentMusicId2(Comment comment) {
        return commentMapper.deleteCommentByCommentMusicId2(comment);
    }
}
